package org.yoshiori.commons.security;

import java.net.MalformedURLException;
import java.net.URL;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

public class XmlRpcUtils {

	private static final Log log = LogFactory.getLog(XmlRpcUtils.class);
	
	public static XmlRpcClient getXmlRpcClient(String url){
		XmlRpcClient client = new XmlRpcClient();
		XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
		try {
			config.setServerURL(new URL(url));
		} catch (MalformedURLException e) {
			log.error(e, e);
		}
		client.setConfig(config);

		return client;
	}
}
